This application claims priority from JP2004-31932 filed Feb. 9, 2004 herein incorporated by reference in their entirety.
1. Field of the Invention
The present invention relates to an image processing apparatus, method, and program for correcting image data. In particular, the invention relates to an image processing technique for effecting an interpolating operation which allows appropriate correction or “retouching” of the image data even when a boundary (edge) or pattern portion of a photographically recorded image is present within its defective portion, by appropriately reflecting such boundary, pattern or the like in the correction.
2. Description of the Related Art
A photographic film may include a defective portion on its surface, such as a scar, dust, dirt, etc. Then, when a photographically recorded image is read from such “defective” film to be printed on a print sheet or outputted on a display, there is known a technique available for correcting such defect by means of an image processing operation relying on e.g. a luminance adjustment technique and an interpolating technique.
An exemplary technique is known from Japanese Patent Application “Kokai” No.: 11-98370 (at pages 15-16, FIG. 4 thereof in particular). This technique effects correction by way of luminance adjustment, based on the unique property of infrared beam. Namely, unlike the visible beam, the infrared beam, when irradiated on an exposed photographic film, is hardly affected by a photographic image recorded thereon, but affected only by such physical defect as a scar, dust or the like. Referring more particularly to this technique, both infrared beam and visible beam are irradiated on an exposed photographic film. Then, a portion of the film where a pixel value of infrared image data is below a predetermined threshold is determined as a defective portion. Then, to a pixel value of each color component (red (R), green (G), blue (B)) of this defective portion, a correction value is added as a “gain” which corresponds to an amount of luminance attenuation occurring in the defective portion relative to a normal (non-defective) portion of the film, thereby to positively increase the luminance. In this way, the pixel value of each color component of the defective portion is adjusted or corrected relative to the normal portion by means of luminance enhancement.
However, this luminance adjustment technique is based on an assumption that the pixel values of the respective color components of the defective portion have experienced an equal amount of luminance attenuation. For this reason, if the amounts of attenuation in the pixel values of the respective color components differ from each other as may happen in the case of a scar in an emulsion surface on the film, the above technique cannot correct this defect appropriately.
In such case, an interpolation technique may be employed which corrects the defective portion by utilizing pixel values of non-defective, i.e. normal pixels adjacent thereto as reference values for the defect correction. However, if the defective portion includes a boundary (edge) or a pattern of the photographic image recorded on the film, such defective portion cannot be properly corrected by the above technique if it simply applies pixel values of adjacent non-defective pixels to the defective portion for its correction. In an attempt to cope with this problem, there has been proposed a further technique known from e.g. Japanese Patent Application “Kokai” No. 2001-78038 (in particular, at pages 7-8, FIGS. 4-5 and FIG. 8), which detects a direction along which the image boundary is present and then effects the interpolation along that detected direction. More particularly, along a plurality of differing directions from the defective portion, the technique calculates image “attribute” values such as a density gradient of the normal pixels, a distance between the normal pixels, etc. Then, for each of the plural directions, based on the data of normal pixels present along a predetermined direction relative to the defective portion on the image, a correction value for correcting the defective portion is obtained by interpolation. Thereafter, based on the calculated image attribute values and the correction values calculated for the respective directions, a final correction value is obtained and used for correcting the defective portion.
Yet, this conventional interpolation correction technique exemplified by the Japanese Patent Application “Kokai” No. 2001-78038 discussed above still suffers a problem as follows. Namely, in searching normal pixels along the plurality of differing directions from the defective pixel to be corrected, this technique needs to determine whether each pixel is a normal pixel or not, for one pixel after another from a pixel adjacent the defective pixel to other pixels present on the outer side. Hence, if the area including the defective pixel is large, there occurs increase in the load on the calculating section such as a CPU. Accordingly, it is difficult for this technique to increase its processing speed. Especially, if the subject image data comprise a high definition image including a great number of pixels, the number of defective pixels included in one defect is also large, so that there is higher tendency of longer time required for the calculation.
On the other hand, in case the subject image data comprise a high definition image including a great number of pixels, the image boundary, i.e. color-to-color transition in that image will be represented in great details also. Therefore, no accurate correction will be possible unless the precision in detecting the boundary direction in the image is increased. In this regard, in the case of the conventional interpolation correction method exemplified by the Japanese Patent Application “Kokai” No. 2001-78038 discussed above, the directions for searching normal pixels around the defective pixel as the center are fixed, regardless of the image data. Therefore, for a high definition image including a great number of pixels, the number of searching directions for normal pixels will be too small to provide sufficient precision in detecting the directions of the image boundary. Whereas, for an image including a small number of pixels, the number of searching directions for normal pixels will be too large, thus resulting in waste in the time period required for the calculation.